/* Basic editor styles */
.tiptap {
	:first-child {
		margin-top: 0;
	}

	/* List styles */
	ul,
	ol {
		margin: 1.25rem 1rem 1.25rem 0.4rem;
		padding: 0 1rem;

		li p {
			margin-top: 0.25em;
			margin-bottom: 0.25em;
		}
	}

	/* Heading styles */
	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		margin-top: 2.5rem;
		line-height: 1.1;

		text-wrap: pretty;
	}

	h1,
	h2 {
		margin-top: 3.5rem;
		margin-bottom: 1.5rem;
	}

	h1 {
		font-size: 1.4rem;
	}

	h2 {
		font-size: 1.2rem;
	}

	h3 {
		font-size: 1.1rem;
	}

	h4,
	h5,
	h6 {
		font-size: 1rem;
	}

	/* Code and preformatted text styles */
	code {
		padding: 0.25em 0.3em;
		border-radius: 0.4rem;
		background-color: var(--purple-light);
		font-size: 0.85rem;
		color: var(--black);
	}

	pre {
		margin: 1.5rem 0;
		padding: 0.75rem 1rem;
		border-radius: 0.5rem;
		background: var(--black);
		font-family: 'JetBrainsMono', monospace;
		color: var(--white);

		code {
			padding: 0;
			background: none;
			font-size: 0.8rem;
			color: inherit;
		}
	}

	blockquote {
		margin: 1.5rem 0;
		padding-left: 1rem;
		border-left: 3px solid var(--gray-3);
	}

	hr {
		margin: 2rem 0;
		border: none;
		border-top: 1px solid var(--gray-2);
	}

	/* Highlight specific styles */
	mark {
		padding: 0.1rem 0.3rem;
		border-radius: 0.4rem;
		background-color: #faf594;

		box-decoration-break: clone;
	}

	/* Task list specific styles */
	ul[data-type='taskList'] {
		list-style: none;
		margin-left: 0;
		padding: 0;

		li {
			display: flex;
			align-items: flex-start;

			> label {
				flex: 0 0 auto;
				margin-right: 0.5rem;
				user-select: none;
			}

			> div {
				flex: 1 1 auto;
			}
		}

		input[type='checkbox'] {
			cursor: pointer;
		}

		ul[data-type='taskList'] {
			margin: 0;
		}
	}

	p {
		word-break: break-all;
	}

	/* Give a remote user a caret */
	.collaboration-cursor__caret {
		position: relative;
		margin-left: -1px;
		margin-right: -1px;
		border-left: 1px solid #0d0d0d;
		border-right: 1px solid #0d0d0d;
		pointer-events: none;
		word-break: normal;
	}

	/* Render the username above the caret */
	.collaboration-cursor__label {
		position: absolute;
		left: -1px;
		top: -1.4em;
		padding: 0.1rem 0.3rem;
		border-radius: 3px 3px 3px 0;
		user-select: none;
		line-height: normal;
		font-style: normal;
		font-weight: 600;
		font-size: 12px;
		color: #0d0d0d;
		white-space: nowrap;
	}
}

.col-group {
	display: flex;
	flex-direction: row;
	height: 100vh;

	@media (max-width: 540px) {
		flex-direction: column;
	}
}

/* Column-half */
body {
	overflow: hidden;
}

.column-half {
	display: flex;
	overflow: auto;
	flex-direction: column;
	flex: 1;

	&:last-child {
		border-left: 1px solid var(--gray-3);

		@media (max-width: 540px) {
			border-left: none;
			border-top: 1px solid var(--gray-3);
		}
	}

	& > .main-group {
		flex-grow: 1;
	}
}

/* Collaboration status */
.collab-status-group {
	display: flex;
	position: sticky;
	bottom: 0;
	z-index: 100;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	padding: 0.375rem 0.5rem 0.375rem 1rem;
	border-top: 1px solid var(--gray-3);
	width: 100%;
	background-color: var(--white);
	font-weight: 400;
	font-size: 0.75rem;
	color: var(--gray-5);

	gap: 1rem;

	button {
		display: -webkit-box;
		overflow: hidden;
		position: relative;
		align-self: stretch;
		flex-shrink: 1;
		padding: 0.25rem 0.375rem;
		max-width: 100%;
		background: none;
		text-overflow: ellipsis;
		font-size: 0.75rem;
		white-space: nowrap;

		-webkit-box-orient: vertical;
		-webkit-line-clamp: 1;

		&::before {
			position: absolute;
			left: 0;
			top: 0;
			z-index: -1;
			border-radius: 0.375rem;
			width: 100%;
			height: 100%;
			background-color: var(--color);
			opacity: 0.5;
			content: '';
			transition: all 0.2s cubic-bezier(0.65, 0.05, 0.36, 1);
		}

		&:hover::before {
			opacity: 1;
		}
	}

	label {
		display: flex;
		flex-direction: row;
		align-items: center;
		flex-shrink: 0;
		line-height: 1.1;

		gap: 0.375rem;

		&::before {
			border-radius: 50%;
			width: 0.35rem;
			height: 0.35rem;
			content: ' ';
		}
	}

	&[data-state='online'] {
		label {
			&::before {
				background-color: var(--green);
			}
		}
	}

	&[data-state='offline'] {
		label {
			&::before {
				background-color: var(--red);
			}
		}
	}
}
